package com.ruoyi.system.service.impl.user;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.user.VsUserRuleMapper;
import com.ruoyi.system.domain.user.VsUserRule;
import com.ruoyi.system.service.user.IVsUserRuleService;

/**
 * 会员规则Service业务层处理
 * 
 * @author zzx
 * @date 2024-04-30
 */
@Service
public class VsUserRuleServiceImpl implements IVsUserRuleService 
{
    @Autowired
    private VsUserRuleMapper vsUserRuleMapper;

    /**
     * 查询会员规则
     * 
     * @param id 会员规则主键
     * @return 会员规则
     */
    @Override
    public VsUserRule selectVsUserRuleById(Long id)
    {
        return vsUserRuleMapper.selectVsUserRuleById(id);
    }

    /**
     * 查询会员规则列表
     * 
     * @param vsUserRule 会员规则
     * @return 会员规则
     */
    @Override
    public List<VsUserRule> selectVsUserRuleList(VsUserRule vsUserRule)
    {
        return vsUserRuleMapper.selectVsUserRuleList(vsUserRule);
    }

    /**
     * 新增会员规则
     * 
     * @param vsUserRule 会员规则
     * @return 结果
     */
    @Override
    public int insertVsUserRule(VsUserRule vsUserRule)
    {
        vsUserRule.setCreatetime(System.currentTimeMillis());
        vsUserRule.setUpdatetime(System.currentTimeMillis());
        return vsUserRuleMapper.insertVsUserRule(vsUserRule);
    }

    /**
     * 修改会员规则
     * 
     * @param vsUserRule 会员规则
     * @return 结果
     */
    @Override
    public int updateVsUserRule(VsUserRule vsUserRule)
    {
        vsUserRule.setUpdatetime(System.currentTimeMillis());
        return vsUserRuleMapper.updateVsUserRule(vsUserRule);
    }

    /**
     * 批量删除会员规则
     * 
     * @param ids 需要删除的会员规则主键
     * @return 结果
     */
    @Override
    public int deleteVsUserRuleByIds(Long[] ids)
    {
        return vsUserRuleMapper.deleteVsUserRuleByIds(ids);
    }

    /**
     * 删除会员规则信息
     * 
     * @param id 会员规则主键
     * @return 结果
     */
    @Override
    public int deleteVsUserRuleById(Long id)
    {
        return vsUserRuleMapper.deleteVsUserRuleById(id);
    }
}
